﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLCHHoaLan
{
    public partial class Menu : Form
    {
        public int kq;      
        public Menu()
        {
            InitializeComponent();
        }
        private void Menu_Load(object sender, EventArgs e)
        {
            if (kq == 1)
            {
                DangNhapThanhCong();
                btnDangNhap.Visible = false;
            }
            else
            {
                ChuaDangNhap();
                btnDangNhap.Visible = true;
            }
        }
        public void DangNhapThanhCong()
        {
            btnBanHang.Enabled = true;
            btnDHChuaGiao.Enabled = true;
            btnQLHangGui.Enabled = true;
            btnQLHoa.Enabled = true;
            btnQLKhachHang.Enabled = true;
            btnQLNCC.Enabled = true;
            btnQLNhapHang.Enabled = true;
            btnThongKe.Enabled = true;
            btnTimKiem.Enabled = true;            
        }
        public void ChuaDangNhap()
        {
            btnBanHang.Enabled = false;
            btnDHChuaGiao.Enabled = false;
            btnQLHangGui.Enabled = false;
            btnQLHoa.Enabled = false;
            btnQLKhachHang.Enabled = false;
            btnQLNCC.Enabled = false;
            btnQLNhapHang.Enabled = false;
            btnThongKe.Enabled = false;
            btnTimKiem.Enabled = false;
        }
        private void btnBanHang_Click(object sender, EventArgs e)
        {
            FrmBanHang frm = new FrmBanHang();
            frm.Show();
            this.Hide();  
     
        }
      
        private void btnThoat_Click(object sender, EventArgs e)        
        {
            Application.Exit();
        }

        private void btnQLHoa_Click(object sender, EventArgs e)
        {            
            FrmQuanLyHoa frm = new FrmQuanLyHoa();
            frm.Show();
            this.Hide();
        }

        private void btnQLKhachHang_Click(object sender, EventArgs e)
        {           
            FrmQuanLyKhachHang frm = new FrmQuanLyKhachHang();
            frm.Show();
            this.Hide();
        }

        private void btnTimKiem_Click(object sender, EventArgs e)
        {           
            FrmTimKiem frm = new FrmTimKiem();
            frm.Show();
            this.Hide();
        }

        private void btnQLNhapHang_Click(object sender, EventArgs e)
        {          
            FrmQuanLyNhapHang frm = new FrmQuanLyNhapHang();
            frm.Show();
            this.Hide();
        }

        private void btnQLNCC_Click(object sender, EventArgs e)
        {            
            FrmQuanLyNhaCungCap frm = new FrmQuanLyNhaCungCap();
            frm.Show();
            this.Hide();
        }

        private void btnThongKe_Click(object sender, EventArgs e)
        {           
            FrmThongKeBaoCao frm = new FrmThongKeBaoCao();
            frm.Show();
            this.Hide();
        }


        private void btnDHChuaGiao_Click(object sender, EventArgs e)
        {          
            FrmDonHangChuaGiao frm = new FrmDonHangChuaGiao();
            frm.Show();
            this.Hide();
        }

        private void btnQLHangGui_Click(object sender, EventArgs e)
        {            
            FrmQuanLyHangGui frm = new FrmQuanLyHangGui();
            frm.Show();
            this.Hide();
        }

        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            FrmDangNhap frm = new FrmDangNhap();
            frm.Show();
            this.Hide();
        }

       
    }
}
